package entity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 黄军艳
 * @version 1.0
 * @date 2024/11/29  11:22
 */
public class Pet {
    private static final Logger LOGGER= LoggerFactory.getLogger(Pet.class);
    //宠物
    public Pet(){}
    private String name; //宠物名
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        //如果setAge被调用，则输出日志
        LOGGER.debug("Pet对象的setAge方法被调用！参数age={}",age);
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void introduce(){
        System.out.println("我是'"+this.name+"'，今年"+this.age+"岁");
    }
}
